import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types'
//列表数据
export const columns : BasicColumn[] = [
	{
		title: '用户',
		align: "center",
		dataIndex: 'userId_dictText'
	},
	{
		title: '是否发起人',
		align: "center",
		dataIndex: 'isSponsor_dictText'
	},
	{
		title: '活动',
		align: "center",
		dataIndex: 'mainId_dictText'
	},
	{
		title: '拼包车id',
		align: "center",
		dataIndex: 'carpoolBus_dictText'
	},
	{
		title: '拼包车类别',
		align: "center",
		dataIndex: 'carpoolType_dictText'
	},
	{
		title: '订单状态',
		align: "center",
		dataIndex: 'orderStatus_dictText'
	},
	{
		title: '报名人数',
		align: "center",
		dataIndex: 'registrationPopulation'
	},
	{
		title: '转出转入',
		align: "center",
		dataIndex: 'rollOrIn_dictText'
	},
	{
		title: '转出到商家',
		align: "center",
		dataIndex: 'rollOutShopId'
	},
	{
		title: '商家转入',
		align: "center",
		dataIndex: 'rollInShopId'
	},
	{
		title: '订单编号',
		align: "center",
		dataIndex: 'orderNo'
	},
];
//查询数据
export const searchFormSchema : FormSchema[] = [
	{
		label: "用户",
		field: "userId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_user,user_name,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "是否发起人",
		field: "isSponsor",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
		//colProps: {span: 6},
	},
	{
		label: "活动",
		field: "mainId",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "拼包车id",
		field: "carpoolBus",
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_carpool_bus,carpool_number,id"
		},
		//colProps: {span: 6},
	},
	{
		label: "拼包车类别",
		field: "carpoolType",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
		//colProps: {span: 6},
	},
	{
		label: "订单状态",
		field: "orderStatus",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
		//colProps: {span: 6},
	},
	{
		label: "转出转入",
		field: "rollOrIn",
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
		//colProps: {span: 6},
	},
];
//表单数据
export const formSchema : FormSchema[] = [
	{
		label: '用户',
		field: 'userId',
		component: 'JSearchSelect',
		slot: 'userIds'
	},
	{
		label: '是否发起人',
		field: 'isSponsor',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "is"
		},
	},
	{
		label: '活动',
		field: 'mainId',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_main,title,id"
		},
	},
	{
		label: '拼包车id',
		field: 'carpoolBus',
		component: 'JSearchSelect',
		componentProps: {
			dict: "couple_activity_carpool_bus,carpool_number,id"
		},
	},
	{
		label: '拼包车类别',
		field: 'carpoolType',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "carpool_type"
		},
	},
	{
		label: '订单状态',
		field: 'orderStatus',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "status_carpool"
		},
	},
	{
		label: '报名人数',
		field: 'registrationPopulation',
		component: 'InputNumber',
	},
	{
		label: '转出转入',
		field: 'rollOrIn',
		component: 'JDictSelectTag',
		componentProps: {
			dictCode: "rool_or_in"
		},
	},
	{
		label: '转出到商家',
		field: 'rollOutShopId',
		component: 'Input',
	},
	{
		label: '商家转入',
		field: 'rollInShopId',
		component: 'Input',
	},
	{
		label: '订单编号',
		field: 'orderNo',
		component: 'Input',
	},
	// TODO 主键隐藏字段，目前写死为ID
	{
		label: '',
		field: 'id',
		component: 'Input',
		show: false
	},
];
//子表单数据
//子表表格配置
export const coupleActivityOrderApplyInfoColumns : JVxeColumn[] = [
	{
		title: '身份证',
		key: 'card',
		type: JVxeTypes.input,
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '姓名',
		key: 'name',
		type: JVxeTypes.input,
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '电话',
		key: 'phone',
		type: JVxeTypes.input,
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '合同id',
		key: 'contractId',
		type: JVxeTypes.select,
		options: [],
		dictCode: "content,title,id",
		disabled: true,
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '合同',
		key: 'contractImg',
		type: JVxeTypes.input,
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '签名图',
		key: 'signatureImg',
		type: JVxeTypes.input,
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '报名人',
		key: 'userId',
		type: JVxeTypes.selectSearch,
		dictCode: "couple_user,user_name,id",
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '签字人',
		key: 'signatureId',
		type: JVxeTypes.selectSearch,
		dictCode: "couple_user,user_name,id",
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
	{
		title: '活动',
		key: 'activityId',
		type: JVxeTypes.selectSearch,
		dictCode: "couple_user,user_name,id",
		width: "200px",
		placeholder: '请输入${title}',
		defaultValue: '',
	},
]


/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData) : FormSchema[] {
	// 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
	return formSchema;
}